package com.bestcem.xm.survey.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.bestcem.xm.component.mybatis.service.IXmService;
import com.bestcem.xm.qdes.grpc.v1.services.QdesProject;
import com.bestcem.xm.survey.entity.SurveyColumn;
import com.bestcem.xm.survey.entity.SurveyFilter;
import com.bestcem.xm.survey.entity.SurveyRespondentAttachment;
import com.bestcem.xm.survey.entity.SurveyRespondentData;
import com.bestcem.xm.survey.grpc.client.dto.QstructsDto;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author guita
 * @description 针对表【ds_survey_column】的数据库操作Service
 * @createDate 2023-01-09 15:15:37
 */
public interface SurveyColumnService extends IXmService<SurveyColumn> {

    JSONObject putSurveyColumns(String surveyColumnId, String projectId, JSONObject param);

    Map<String, Integer> putResume(String projectId, String seq, JSONObject param);

    Map<String, Integer> putDiscard(String projectId, String seq, JSONObject param) throws Exception;

    SurveyFilter getFilter(String projectId);

    void putFilter(String projectId, JSONObject args);

    JSONObject getRespondentsDetail(String seq, JSONObject args);

    List<SurveyRespondentAttachment> getAttachments(String projectId, String seq);

    String hideEmail(String email, boolean noThrow);

    String hideMobile(String phone, boolean noThrow);

    JSONObject getScoreGidDict(JSONObject scores, QstructsDto qstructsDto);

    Set<String> getQstructItemsGids(Object item);

    JSONObject getRespondentsAnswers(String projectId, HttpServletRequest request);

    JSONObject putRespondentsAnswers(String projectId, JSONObject param);

    Map<String, Integer> deleteRespondents(String id, JSONObject param);

    String getsurveytitle(String projectId, Integer version);

    SurveyRespondentData getRespondentDataByRid(String rid, String projectId);

    JSONObject getUidsSensitives(String projectId, String userId);

    Object parseAnswers(JSONObject param, QdesProject project);

    boolean checkQuestionSensitive(JSONObject param, String gid);

    Double getScoreByAnswer(JSONObject param);

    Object postRespondentsById(String id, JSONObject param);

    Object postRespondentsPage(JSONObject param);

    Object postRespondents(JSONObject param);

    Integer parseAnswerItem(JSONObject param, Integer index);

    JSONArray parseCustomAnswers(String customAnswers);

    String getdeliverChannelName(String key);
}
